Repository navigation
Conversation
load_pb_connections sent the connect with send_notmodified and discarded the response, then appended to self.connections unconditionally. A port named in the pedalboard can be absent from JACK -- a MIDI device that is not plugged in or not enabled -- so the connect fails and the entry becomes a phantom. A phantom is never retried. connect() short-circuits on its "already exists" guard, and save() serialises self.connections into the pedalboard as a real ingen:arc, so the phantom survives a reload. Pass a callback and append only on success. This matches jack_port_appeared, which already checks connect_jack_ports() before it records anything. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Collaborator
Author
|
Closed without a merge. This change is not tested against a known failure. The fault in This change also makes the operation asynchronous. The branch |
An error occurred while trying to automatically change base from
fix/stale-connections-on-midi-mode-switch
to
main
August 21, 2026 05:22
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
load_pb_connectionssends each connect command withsend_notmodifiedand discards the reply. Then it adds the entry toself.connections:A port that a pedalboard file names can be absent from JACK. This occurs if a MIDI device is not connected, or if the user did not enable the device. The connect command then fails. But mod-ui adds the entry to the record.
Effect
self.connectionsis the record that mod-ui keeps of the JACK graph. An incorrect entry has three effects:connect()starts with a test of this record. The test finds the incorrect entry and stops. mod-ui sendstrueto the browser, but mod-ui does not send the command to mod-host. The user cannot make that cable.save()writes this record to the pedalboard file as aningen:arc. The incorrect entry stays after a reload.Change
load_pb_connectionssends a callback with the connect command. It adds the entry to the record only if mod-host confirms the connection. If mod-host does not confirm, the code writes an error message and adds no entry.jack_port_appearedalready operates in this manner. It examines the result ofconnect_jack_ports()before it makes a record:Status of the tests
Read this section before you approve this pull request.
This change is not tested against a known failure. The related pull request #6 corrects a different code path with the same fault. That fault was made again on hardware, and the correction was tested. This code path has the same shape, but a failure from this path was not made again.
This change also makes the operation asynchronous. Before this change,
self.connectionswas complete whenload_pb_connectionsended. After this change, the entries are added when mod-host replies. Code that readsself.connectionsimmediately after a pedalboard load can find fewer entries. Two examples are a browser that connects during the load, and a save operation immediately after the load. This condition was not tested.Upstream
This code is the same in upstream
mod-audio/mod-uiat master (commit0467c103), atmod/host.py:3953. No upstream issue reports this problem.